package com.kgc.scd.service;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * Created On : 2022/11/17 0017.
 * <p>
 * Author : shiguangchuan
 * <p>
 * Description: SendMessageFeignService
 */
@FeignClient(value = "wyyxmall-sgc-server")
public interface SendMessageFeignService {
    
    /**
     * @author : shiguangchuan
     * @date   : 2022/11/17 0017
     * @param  : [goodsId]
     * @return : boolean
     * @description : 登记没货的商品加货时提醒 
     */
    @GetMapping("/sgcServer/needSendMessage")
    boolean feignInvokeSendMessage(@RequestParam("phoneNum") String phoneNum,
                                   @RequestParam("goodsId") String goodsId);
    
    /**
     * @author : shiguangchuan
     * @date   : 2022/11/18 0018
     * @param  : [goodsId, goodsNumber]
     * @return : void
     * @description : 加货成功后，发送短信提醒
     */
    @PostMapping("/sgcServer/addGoodsStock")
    void feignInvokeAddStockToSendMessage(@RequestParam("goodsId") String goodsId,
                                          @RequestParam("goodsNumber") Integer goodsNumber);
    
}
